local skel = fk.CreateSkill {
  name = "rmt__tufuc",
  tags = {Skill.Lord, Skill.Compulsory}
}

Fk:loadTranslationTable{
  ["rmt__tufuc"] = "图附",
  [":rmt__tufuc"] = "主公技，锁定技，游戏开始时，燕势力角色依次选择一项：其对你造成1点伤害，或你对其造成1点伤害。",

  ["rmt__tufuc1"] = "你对 %src 造成1点伤害",
  ["rmt__tufuc2"] = "%src 对你造成1点伤害",

  ["$rmt__tufuc1"] = "九仞之功，不让一篑，岂可怒而轻掷？",
  ["$rmt__tufuc2"] = "朝摩燕阙，暮谒秦关，古时未能有也。",
}

skel:addEffect(fk.GameStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local targets = table.filter(room:getAlivePlayers(), function (p)
      return p.kingdom == "yan"
    end)
    if #targets == 0 then return end
    room:doIndicate(player, targets)
    for _, p in ipairs(targets) do
      if not p.dead then
        if player.dead or p == player then
          room:damage{
            from = player,
            to = p,
            damage = 1,
            skillName = skel.name,
          }
        else
          local choice = room:askToChoice(p, {choices = {"rmt__tufuc1:"..player.id, "rmt__tufuc2:"..player.id}, skill_name = skel.name})
          if choice[16] == 1 then
            room:damage{
              from = p,
              to = player,
              damage = 1,
              skillName = skel.name,
            }
          else
            room:damage{
              from = player,
              to = p,
              damage = 1,
              skillName = skel.name,
            }
          end
        end
      end
    end
  end,
})

return skel
